package cn.alibab.news.controller;

import cn.alibab.common.model.R;
import cn.alibab.news.service.NewsAlarmService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shiyk
 * @create 2020-07-16 17:50
 */
@RestController
@RequestMapping("news/alarm")
public class NewsAlarmController {
    private final NewsAlarmService newsAlarmService;

    public NewsAlarmController(NewsAlarmService newsAlarmService) {
        this.newsAlarmService = newsAlarmService;
    }
    @GetMapping
    @RequiresPermissions("news:alarm:get")
    public R getAlarm(){
        return newsAlarmService.getAlarm();
    }
}
